from socket import *
from time import ctime
serSock=socket(AF_INET,SOCK_STREAM)
serSock.bind(('',22224))
serSock.listen(5)

while True:
    print 'waiting...'
    cliSock,addr=serSock.accept()
    print 'connect:',addr
    while True:
        data=cliSock.recv(1024)
        if not data:
            break
        cliSock.send('[%s]%s'%(ctime(),data))

cliSock.close()
serSock.close()
    
